package com.gm.springboot.mapper;

import com.gm.springboot.bean.Major;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author Administrator
 * @Date 2020/7/2 17:25
 **/
public interface MajorMapper {
    @Select("select * from tb_major")
    List<Major> findMajorAll();
    @Delete("delete from tb_major where mid=#{mid}")
    int delMajor(Integer mid);
    @Insert("insert into tb_major(mname,mdesc) values(#{mname},#{mdesc})")
    int addMajor(Major major);
    @Select("select * from tb_major where mid=#{mid}")
    Major findMajorById(Integer mid);
    @Update("update tb_major set mname=#{mname},mdesc=#{mdesc} where mid=#{mid}")
    int updMajor(Major major);
}
